#ifndef __USE_OPTIONS_H
#define __USE_OPTIONS_H
#include "twl.h"
#include "twl_ini.h"
#include <string>
using std::string;

class OptionsBase {
protected:
 IniFile* m_ini;
 char* m_section;
 bool m_writing;
public:
  OptionsBase(IniFile* inf, char* s);
  ~OptionsBase();
  void write();
  void read();
  void load_defaults();
  virtual void stream(bool is_writing) = 0;

  void map(pchar name, string& s, pchar def);
  void map(pchar name, int& val, int def);
  void map(pchar name, float& val, float def);
};

class FormOptions: public OptionsBase {
protected:
  TWin* m_form;
public:
   FormOptions(TWin* p, IniFile* inf);
   ~FormOptions();
   void set_form(TWin* p);
   void clear_form();
   void stream(bool is_writing);
};
#endif

